<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>学生成绩管理系统 - 登录</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        /* 背景装饰圆圈 */
        body::before,
        body::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            background: rgba(33, 150, 243, 0.1);
        }

        body::before {
            width: 400px;
            height: 400px;
            top: -100px;
            right: -100px;
        }

        body::after {
            width: 300px;
            height: 300px;
            bottom: -50px;
            left: -50px;
            background: rgba(25, 118, 210, 0.1);
        }

        .login-container {
            width: 420px;
            padding: 45px 40px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 24px;
            box-shadow: 0 20px 60px rgba(21, 101, 192, 0.15);
            text-align: center;
            position: relative;
            z-index: 10;
            border: 1px solid rgba(255, 255, 255, 0.8);
            animation: fadeInUp 0.6s ease-out;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .login-header {
            margin-bottom: 35px;
        }

        .login-header .logo {
            width: 70px;
            height: 70px;
            background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 36px;
            box-shadow: 0 8px 20px rgba(33, 150, 243, 0.3);
        }

        .login-header h2 {
            color: #1565c0;
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .login-header p {
            color: #546e7a;
            font-size: 14px;
        }

        .input-group {
            position: relative;
            margin-bottom: 20px;
        }

        .input-group .icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 20px;
            color: #1976d2;
            z-index: 1;
        }

        input {
            width: 100%;
            padding: 15px 15px 15px 50px;
            border: 2px solid #e3f2fd;
            border-radius: 12px;
            font-size: 15px;
            transition: all 0.3s;
            background: white;
            color: #333;
        }

        input:focus {
            outline: none;
            border-color: #2196f3;
            box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
        }

        input::placeholder {
            color: #90a4ae;
        }

        button {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
            border: none;
            color: white;
            font-size: 16px;
            font-weight: 600;
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
            margin-top: 10px;
        }

        button:hover {
            background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
        }

        button:active {
            transform: translateY(0);
        }

        .error-message {
            margin-top: 20px;
            padding: 12px;
            background: rgba(244, 67, 54, 0.1);
            border: 1px solid rgba(244, 67, 54, 0.3);
            border-radius: 8px;
            color: #d32f2f;
            font-size: 14px;
            animation: shake 0.5s;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-10px); }
            75% { transform: translateX(10px); }
        }

        .footer-links {
            margin-top: 25px;
            padding-top: 20px;
            border-top: 1px solid #e3f2fd;
        }

        .footer-links a {
            color: #1976d2;
            text-decoration: none;
            font-size: 14px;
            margin: 0 10px;
            transition: color 0.3s;
        }

        .footer-links a:hover {
            color: #1565c0;
            text-decoration: underline;
        }

        /* 响应式设计 */
        @media (max-width: 480px) {
            .login-container {
                width: 90%;
                padding: 35px 25px;
            }

            .login-header h2 {
                font-size: 20px;
            }
        }

        /* 滚动条美化 */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #e3f2fd;
        }

        ::-webkit-scrollbar-thumb {
            background: #2196f3;
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #1976d2;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-header">
        <div class="logo">🎓</div>
        <h2>学生成绩管理系统</h2>
    </div>

    <form action="/login" method="post">
        <div class="input-group">
            <span class="icon">👤</span>
            <input type="text" name="username" placeholder="请输入用户名" required>
        </div>

        <div class="input-group">
            <span class="icon">🔒</span>
            <input type="password" name="password" placeholder="请输入密码" required>
        </div>

        <button type="submit">登录</button>

        <div th:if="${param.error}" class="error-message">
            ⚠️ 用户名或密码错误,请重试!
        </div>
    </form>

    <div class="footer-links">
        <a href="#forgot">忘记密码?</a>
        <span style="color: #ccc;">|</span>
        <a href="#register">注册账户</a>
    </div>
</div>

<script>
    // 添加输入框聚焦动画
    document.querySelectorAll('input').forEach(input => {
        input.addEventListener('focus', function() {
            this.parentElement.querySelector('.icon').style.transform = 'translateY(-50%) scale(1.2)';
        });

        input.addEventListener('blur', function() {
            this.parentElement.querySelector('.icon').style.transform = 'translateY(-50%) scale(1)';
        });
    });

    // 表单提交动画
    document.querySelector('form').addEventListener('submit', function(e) {
        const button = this.querySelector('button');
        button.innerHTML = '登录中...';
        button.style.background = 'linear-gradient(135deg, #1565c0 0%, #1976d2 100%)';
    });
</script>
</body>
</html>